/*
 * HtmlDataParser.cpp
 *
 *  Created on: 2010-9-6
 *      Author: anod
 */

#include <Module-AppData/HtmlDataParser.hpp>
#include <Module-AppConfig/AppConfig.hpp>
#include <Module-AppData/parser/ScriptParser.hpp>
#include <Module-AppData/parser/DllFuncParser.hpp>
#include <Module-AppData/parser/ProcessParser.hpp>

namespace AppData
{

HtmlDataParser* HtmlDataParser::createParser( int _policy )
{
	HtmlDataParser *_impl;
	switch(_policy)
	{
		case AppConfig::WidgetConfig::POLICY_TYPE_SCRIPT:
			_impl = new ScriptParser();
			break;
		case AppConfig::WidgetConfig::POLICY_TYPE_PROCESS:
			_impl = new ProcessParser();
			break;
		case AppConfig::WidgetConfig::POLICY_TYPE_SHAREDLIB:
			_impl = new DllFuncParser();
			break;
		default:
			_impl = NULL;
	}
	return _impl;
}

void HtmlDataParser::destroyParser( HtmlDataParser *_parser )
{
	if( _parser != NULL )
		delete _parser;
}

HtmlDataParser::~HtmlDataParser(){}

}
